package com.define.commons.dao.autoconfig;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 自动配置支持的属性
 * @Author xiewenlong
 * @Date 2018/11/16 14:48
 */
@Data
@Slf4j
@ConfigurationProperties(prefix = "dao")
public class DaoProperties implements InitializingBean {
    /** Jpa DDLAuto */
    private String ddlAuto = "update";
    /* databasePlatform */
    private String databasePlatform = "org.hibernate.dialect.MySQL5InnoDBDialect";
    /** Jpa ShowSql */
    private boolean showSql = false;
    /** FastMybatis auto fill insert time field */
    private String dateFillInsert = "insert_time";
    /** FastMybatis auto fill update time field */
    private String dateFillUpdate = "update_time";
    /** FastMybatis 逻辑删除后的值 */
    private String logicDeleteValue = "1";
    /** FastMybatis 逻辑删除前的值 */
    private String logicNotDeleteValue = "0";

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("get commons-dao autoconfig properties: {}", this);
    }
}
